import { createRouter, createWebHashHistory } from "vue-router"

const HomeComponent = { template: '<p>Home page</p>' }

import HelloWord from '../components/HelloWorld.vue'

import ablbum_3D_1 from '../views/album/3d_1.vue'
import ablbum_3D_2 from '../views/album/3d_2.vue'

const routes = [
  {
      path: '/',
      name: 'HomeComponent',
      component: HomeComponent
  },
  {
      path: '/HelloWord',
      name: 'HelloWord',
      // component: resolve => require(['@/components/HelloWorld'], resolve)
			component: HelloWord
			// component: () => import('/@/components/HelloWorld.vue')
  },
	{
	    path: '/3d_1',
	    name: '3D_1',
	    component: ablbum_3D_1
	},
	{
	    path: '/3d_2',
	    name: '3D_2',
	    component: ablbum_3D_2
	}
]

/**
 * 创建路由
 */
const router = createRouter({
  history: createWebHashHistory(),
  routes: routes
})

/**
 * 路由守卫
 */
// router.beforeEach((guard) => {
//   beforeEach.checkAuth(guard, router);
// });


/**
 * 路由错误回调
 */
// router.onError((handler: ErrorHandler) => {
//   console.log("error:", handler);
// });
 
/**
 * 输出对象
 */
export default router;


 